package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JButton;

public class TelaPricipal extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaPricipal frame = new TelaPricipal();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TelaPricipal() {
		setTitle("Projeto PSC ");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnFuncionario = new JMenu("Funcionario");
		menuBar.add(mnFuncionario);
		
		JMenuItem mntmNovo = new JMenuItem("Novo");
		mntmNovo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
					TelaNovoFuncionario t = new TelaNovoFuncionario();
					t.setVisible(true);
					dispose();
			}
		});
		mnFuncionario.add(mntmNovo);
		
		JMenuItem mntmBusca = new JMenuItem("Busca");
		mntmBusca.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				TelaBuscaFuncionario tbusca = new TelaBuscaFuncionario();
				tbusca.setVisible(true);
				dispose();
			}
		});
		mnFuncionario.add(mntmBusca);
		
		JMenu mnCliente = new JMenu("Cliente");
		menuBar.add(mnCliente);
		
		JMenuItem mntmNovo_1 = new JMenuItem("Novo ");
		mnCliente.add(mntmNovo_1);
		
		JMenuItem mntmBuscar = new JMenuItem("Buscar");
		mnCliente.add(mntmBuscar);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JButton btnNewButton = new JButton("Fechar");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		contentPane.add(btnNewButton, BorderLayout.SOUTH);
        setSize(1280,750);
        this.setLocationRelativeTo(null);// centraliza a tela  
	}

}
